function Add-UserToLocalAdmins
{
    Param
    (
		[string] $User,
		[string] $Computer,
		[string] $Domain
    )

	Begin
	{
		$Group = "Administrators"

		if(!$Domain)
		{
			$Domain = "YOURDOMAIN"
		}
	}
	Process
	{
		if($_)
		{
			$User = $_
		}

		$Server = [ADSI]("WinNT://" + $Computer + ",computer")
		$LocalGroup = $Server.psbase.children.find($Group)
		$LocalGroup.Add("WinNT://" + $Domain + "/" + $User)
	}
}


